<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

	<head>
		<base href="<%=basePath%>">

		<title>学生管理页面</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" />
		<link rel="stylesheet" href="css/common.css" />
		<link rel="stylesheet" href="css/contenRight.css" />
		<link rel="stylesheet" href="css/responsive.css" />
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<script type="text/javascript" src="js/app.js"></script>
		<link rel="stylesheet" href="css/pulg/jquery-ui/jquery-ui.min.css" />
		<script type="text/javascript" src="css/pulg/jquery-ui/jquery-ui.min.js"></script>
	</head>
<script type="text/javascript">
		function submitFrom() {
			var studentID = document.getElementById("studentID").value;
			var studentName = document.getElementById("studentName").value;
			var studentPass = document.getElementById("studentPass").value;
			if(studentID == "" || studentName == "" || studentPass == ""){
				alert("重要信息不能为空！");
			}else{
				$("#submitForm").attr("action","studentAdd");
				$("#submitForm").submit();
			}
		}
	</script>
	<body style="overflow:-Scroll;overflow-x:hidden;overflow-y: hidden;">
		<div class="list-page">
			<div class="list-page-content">
				<div class="taskTabs">
					<ul class="taskOptions">
						<li>
							<a class="btnlist tabs selected" href="#overtime0" id="taskList" >
								<i class="icon-user"></i> 学生考试信息
							</a>
						</li>
						<li>
							<a class="btnAdd permissions_add tabs" href="#overtime1" id="taskAdd"><i class="icon-plus"></i>添加学生</a>
						</li>
					</ul>
					<div class="clear"></div>
					<div id="overtime0" class="task" data-pattern="priority-cloumns" style="display: block;">
						<table class="list-page-content-table datalist">
							<thead>
								<tr>
									<th>学生编号</th>
									<th>学生姓名</th>
									<th>学生班级</th>
									<th>查看学生考试情况</th>
								</tr>
							</thead>
							<tbody>
								<s:iterator value="#request.students" var="student">
									<tr>
										<td>${student.studentID}</td>
										<td>${student.studentName}</td>
										<td>${student.sclass}</td>
										<td>
											<a href="showStudent?studentID=${student.studentID}">查看</a>
										</td>
									</tr>
								</s:iterator>
							</tbody>
						</table>
						<div class="list-page-content-table-paginate">
							<div class="p_pageBox pages">
								<s:if test="#request.page.hasPrePage">
									<a class="p_prev" href="selectStudent?currentPage=${page.currentPage - 1} ">上一页</a>
								</s:if>
								<s:else>
									<a class="p_prev">上一页</a>
								</s:else>
								<c:forEach varStatus="stat" begin="1" end="${page.totalPage}">
									<s:if test="subjectTitle == null">
										<a href="selectStudent?currentPage=${stat.index}">${stat.index}</a>
									</s:if>
									<s:else>
										<a href="selectStudent?currentPage=${stat.index}">${stat.index}</a>
									</s:else>
								</c:forEach>
								<s:if test="#request.page.hasNextPage">
									<a class="p_next" href="selectStudent?currentPage=${page.currentPage + 1} ">下一页</a>
								</s:if>
								<s:else>
									<a class="p_next">下一页</a>
								</s:else>
							</div>
						</div>
						<div class="clear"></div>
					</div>
					<div id="overtime1" class="task" data-pattern="priority-cloumns" style="display: none;">
						<div class="editPage">
							<div class="editPages">
								<div class="editPageTitle">
									<p class="titleLeft">
										<i class="icon-list-alt"></i>
										<span>添加学生</span>
									</p>
									<p class="titleRight">
										<i class="toggleBox icon-chevron-up"></i>
									</p>
									<div class="clear"></div>
								</div>
								<div class="editPageInfo" style="display: block;">
									<form class="form-horizontal editForm" id="submitForm">
										<div class="control-group">
											<label class="control-label">
											<span class="necessary">*</span>
											学生学号：
											</label>
											<div class="controls">
												<input class="m-wrap editP" id="studentID"  name="studentID" type="text" placeholder="请输入学号！"   />
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">
											<span class="necessary">*</span>
											学生姓名：
											</label>
											<div class="controls">
												<input class="m-wrap editP" id="studentName"  name="studentName" type="text" />
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">
											<span class="necessary">*</span>
											学生密码：
											</label>
											<div class="controls">
												<input class="m-wrap editP" id="studentPass"  name="studentPass" type="text" />
											</div>
										</div>
										<div class="control-group">
											<label class="control-label">
											<span class="necessary">*</span>
											学生班级：
											</label>
											<div class="controls">
												<select name="sclass" class="editP">
													<option value="1">一班</option>
													<option value="2">二班</option>
													<option value="3">三班</option>
													<option value="4">四班</option>
													<option value="5">五班</option>
												</select>
											</div>
										</div>
					
									</form>
								</div>
							</div>
							<div class="submitBtn">
								<a class="btn blue btnEdit editP" onclick="submitFrom()">
									<i class="icon-ok"></i>提交
								</a>
								<a class="btn btnReturn" href="subjectQuery">
									<i class="icon-remove"></i>取消
								</a>
							</div>

						</div>
					</div>

					<div class="clear"></div>
				</div>
			</div>
		</div>
	</body>

</html>